home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / mmv10.zip / MMV.MAN < prev    next >
Text File  |  1989-11-22  |  16KB  |  463 lines

  1.  
  2.  
  3.  
  4. MMV(1)                 Programmer's Manual                 MMV(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      mmv - move/copy/append multiple files by wildcard patterns
  10.  
  11. SYNOPSIS
  12.      mmv [-m|x|r|c|o|a|z] [-h] [-d|p] [-g|t] [-v|n] [from to]
  13.      mmvpatch [executable]
  14.  
  15. DESCRIPTION
  16.      _M_m_v moves (or copies, or appends, as specified) each source
  17.      file matching a _f_r_o_m pattern to the target name specified by
  18.      the _t_o pattern.  This multiple action is performed safely,
  19.      i.e. without any unexpected deletion of files due to colli-
  20.      sions of target names with existing filenames or with other
  21.      target names.  Furthermore, before doing anything, _m_m_v
  22.      attempts to detect any errors that would result from the
  23.      entire set of actions specified and gives the user the
  24.      choice of either proceeding by avoiding the offending parts
  25.      or aborting.
  26.  
  27.                            The Task Options
  28.  
  29.      Whether _m_m_v moves, copies, or appends is governed by the
  30.      first set of options given above.  If none of these are
  31.      specified, a default (patchable by _m_m_v_p_a_t_c_h, and initially
  32.      -x) determines the task.
  33.  
  34.      The task option choices are:
  35.  
  36.      -m : move source file to target name.  Both must be on the
  37.           same device.  Will not move directories.
  38.  
  39.      -x : same as -m, except cross-device moves are done by copy-
  40.           ing, then deleting source.  When copying, sets the
  41.           attributes and file modification time of the target
  42.           file to that of the source file.
  43.  
  44.      -r : rename source file or directory to target name.  The
  45.           target name must not include a path: the file remains
  46.           in the same directory in all cases.  This option is the
  47.           only way of renaming directories under _m_m_v.  It is only
  48.           available under DOS version 3.0 or higher.
  49.  
  50.      -c : copy source file to target name.  Sets the file modifi-
  51.           cation time and attributes of the target file to that
  52.           of the source file, regardless of whether the target
  53.           file already exists.  Chains and cycles (to be
  54.           explained below) are not allowed.
  55.  
  56.      -o : overwrite target name with source file.  If target file
  57.           exists, its attributes are left unchanged.  If not, it
  58.           is created with ordinary attributes unrelated to the
  59.           source file's attributes.  In either case, the file
  60.  
  61.  
  62.  
  63. Printed 11/21/89    November 20, 1989 (v1.0)                    1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. MMV(1)                 Programmer's Manual                 MMV(1)
  71.  
  72.  
  73.  
  74.           modification time is set to the current time.
  75.  
  76.      -a : append contents of source file to target name.  Target
  77.           file modification time is set to the current time.  If
  78.           target file does not exist, it is created with attri-
  79.           butes set as under -o.  Unlike all other options, -a
  80.           allows multiple source files to have the same target
  81.           name, e.g. "mmv -a *.c big" will append all ".c" files
  82.           to "big".  Chains and cycles are also allowed, so "mmv
  83.           -a f f" will double up "f".
  84.  
  85.      -z : same as -a, but if the target file exists, and its last
  86.           character is a ^Z, and the source file is not empty,
  87.           this ^Z is truncated before doing the append.
  88.  
  89.      Only one of these option may be given, and it applies to all
  90.      matching files.  Remaining options need not be given
  91.      separately, i.e. "mmv -mk" is allowed.
  92.  
  93.                         Multiple Pattern Pairs
  94.  
  95.      Multiple _f_r_o_m -- _t_o pattern pairs may be specified by omit-
  96.      ting the pattern pair on the command line, and entering them
  97.      on the standard input, one pair per line.  (If a pattern
  98.      pair is given on the command line, the standard input is not
  99.      read.) Thus,
  100.  
  101.         mmv
  102.         a b
  103.         c d
  104.  
  105.      would rename "a" to "b" and "c" to "d".  If a file can be
  106.      matched to several of the given _f_r_o_m patterns, the _t_o pat-
  107.      tern of the first matching pair is used.  Thus,
  108.  
  109.         mmv
  110.         a b
  111.         a c
  112.  
  113.      would give the error message "a -> c : no match" because
  114.      file "a" (even if it exists) was already matched by the
  115.      first pattern pair.
  116.  
  117.                            The _F_r_o_m Pattern
  118.  
  119.      The _f_r_o_m pattern is a filename with embedded wildcards: '*',
  120.      '?', '['...']', '!',  and ';'.  The first three have their
  121.      usual _s_h(1) meanings of, respectively, matching any string
  122.      of characters, matching any single character, and matching
  123.      any one of a set of characters.
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Printed 11/21/89    November 20, 1989 (v1.0)                    2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. MMV(1)                 Programmer's Manual                 MMV(1)
  137.  
  138.  
  139.  
  140.      Between the '[' and ']', a range from character 'a' through
  141.      character 'z' is specified with "a-z".  The set of matching
  142.      characters can be negated by inserting a '^' after the '['.
  143.      Thus, "[^b-e2-5_]" will match any character but 'b' through
  144.      'e', '2' through '5', and '_'.
  145.  
  146.      Unlike DOS wildcards, all mmv wildcards (except for cases
  147.      listed below) can occur anywhere in the pattern, whether
  148.      preceding or following explicit characters or other wild-
  149.      cards.  For example, the pattern "*z\foo.bar" will search
  150.      for files named "foo.bar" in all subdirectories whose names
  151.      end in 'z'.  However, no wildcards can occur in the drive
  152.      letter.
  153.  
  154.      The character '.' is not matched by any of '*', '?', or
  155.      '['...']'.  Thus, the pattern "*" will only match files with
  156.      a null extension.  To save yourself some typing, use the '!'
  157.      wildcard instead, which matches the same as "*.*", except it
  158.      is assigned only one wildcard index (see below).  Thus, both
  159.      "f!" and "f*.*" will match all of "f", "f.ext", "foo", and
  160.      "foo.ext", while "f*" will match only the first and the
  161.      third.
  162.  
  163.      Note that paths are allowed in the patterns, and wildcards
  164.      may be intermingled with slashes arbitrarily.  The ';' wild-
  165.      card is useful for matching files at any depth in the direc-
  166.      tory tree.  It matches the same as "*\" repeated any number
  167.      of times, including zero, and can only occur either at the
  168.      beginning of the pattern or following a '\'.  Thus ";*.c"
  169.      will match all ".c" files in or below the current directory,
  170.      while "\;*.c" will match them anywhere on the file system.
  171.  
  172.      Since matching a directory under a task option other than -r
  173.      or -s would result in an error, tasks other than -r and -s
  174.      match directories only against completely explicit _f_r_o_m pat-
  175.      terns (i.e. not containing wildcards).  Under -r and -s,
  176.      this applies only to "." and "..".
  177.  
  178.      Hidden and system files are also only matched against com-
  179.      pletely explicit _f_r_o_m patterns.   However, if -h is speci-
  180.      fied, they are matched normally.
  181.  
  182.                             The _T_o Pattern
  183.  
  184.      The _t_o pattern is a filename with embedded _w_i_l_d_c_a_r_d _i_n_d_e_x_e_s,
  185.      where an index consists of the character '#' followed by a
  186.      string of digits.  When a source file matches a _f_r_o_m pat-
  187.      tern, a target name for the file is constructed out of the
  188.      _t_o pattern by replacing the wildcard indexes by the actual
  189.      characters that matched the referenced wildcards in the
  190.      source name.  Thus, if the _f_r_o_m pattern is "abc*.*" and the
  191.      _t_o pattern is "xyz#2.#1", then "abc.txt" is targeted to
  192.  
  193.  
  194.  
  195. Printed 11/21/89    November 20, 1989 (v1.0)                    3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. MMV(1)                 Programmer's Manual                 MMV(1)
  203.  
  204.  
  205.  
  206.      "xyztxt.".  (The first '*' matched "", and the second
  207.      matched "txt".) Similarly, for the pattern pair ";*.[clp]"
  208.      -> "#1#3\#2", "foo1\foo2\prog.c" is targeted to
  209.      "foo1\foo2\c\prog".  Note that there is no '\' following the
  210.      "#1" in the _t_o pattern, since the string matched by any ';'
  211.      is always either empty or ends in a '\'.